﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _04_Graph
{
   class Edge : IComparable
   {
      public int weight;   // 权重
      public Node from;
      public Node to;

      public Edge(int weight, Node from, Node to)
      {
         this.weight = weight;
         this.from = from;
         this.to = to;
      }

      public int CompareTo(object obj)
      {
         var edge = obj as Edge;
         return (this.weight - edge.weight);
      }
   }
}
